package com.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class JdbcTest {
    public static Connection connection;


    static {
        try {
//            Class.forName("com.mysql.jdbc.Driver");
//            Class.forName("org.sqlite.JDBC");
            Class.forName("org.h2.Driver");
            try {
//                120.24.239.114
//                connection = DriverManager.getConnection("jdbc:mysql://47.119.155.182/zoo", "zoo", "TKj3ntzNFfttPnwm");
                connection = DriverManager.getConnection("jdbc:h2:mem:test");
//                connection = DriverManager.getConnection("jdbc:mysql://master:3309/fd", "fd", "SbbfnZPzAL8FiE5j");
//                  connection = DriverManager.getConnection("jdbc:sqlite:D:sqlitedata");
            } catch (SQLException e) {
                e.printStackTrace();
            }
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
      }

    public static Connection getConnection(){
        return connection;
    }

    public static void main(String[] args) {
        System.out.println(connection);
    }
}
